<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>

<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="com.example.demo2.DBUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="css/rest.css"/>
	<style type="text/css">
		body{width: 100%;height: 100%;}
		*{margin: 0;padding: 0;}
		.denglu>a{color: white;}
		.bjt{background:radial-gradient(#6f4351,#40325b);width: 100%;height: 120px;}
		.huixiang{width: 200px;height: 80px;position: absolute;left: 0px;top: 10px;}
		.ziti{font-size: 25px;font-style: italic;font-family: 宋体;color:#91b5ff ;font-weight: 600;position: absolute;left:180px;top: 44px;}
		li{float: left;font-size: 22px;padding: 10px;margin-left: 60px;color: aqua;}
		.liebiao{position: absolute;left: 300px;top: 35px;}
		.zixuankuang{font-size: 12px;color: gray;width: 210px;height:38px;position: absolute;left: 1100px;top: 38px;border-radius: 50px;}
		.sousuo{width: 40px;height: 38px;position: absolute;left: 1274px;top: 40px;border-radius: 50px;background-color: dimgray;}
		.yonghu{border-radius: 50px;width: 50px;height: 50px;position: absolute;left: 1390px;top: 30px;}
		.denglu{font-size: 20px;position: absolute;left: 1440px;top: 50px;color:#91b5ff ;background-color: #40325b;border: solid  #423364;}
		li>a{color: white;}
		.si{background-color: black;height: 300px;position: relative;bottom: 0px;margin-top: 10%;}
		.c1{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 450px;top: 50px;}
		.c1-1{color: red;}
		.c2{font-size: 18px;font-weight: 300;position: absolute;left: 520px;top:80px;color: white;}
		.c3{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 600px;top:120px;}
		.c4{height: 40px;width: 130px;position: absolute;left: 580px;top:180px;}
		.c5{height: 40px;width: 130px;position: absolute;left: 740px;top:180px;}
		.c6{height: 40px;width: 130px;position: absolute;left: 900px;top:180px;}
		.z1{height: 400px;width: 1000px;border: solid 1px gray;margin-left: 300px;}
		.z1-1{font-size: 24px;margin-left: 40px;margin-top: 30px;width: 1000px;line-height: 50px;font-weight: 400;}
		.z1-2{font-size: 24px;margin-left: 40px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
		.z1-1-1{background-color: red;border-radius: 50px;color: white;}
		.z2{font-size: 15px;margin-left: 310px;font-size: 30px;margin-top: 30px;}
		.z1-3{font-size: 24px;margin-left: 40px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
		.z1-4{font-size: 24px;margin-left: 40px;margin-top: 40px;width: 1000px;line-height: 50px;font-weight: 400;}
		.v1{font-size: 30px;height: 40px;width: 160px;margin-top: 100px;border-left: solid 8px red;text-align: center;line-height: 40px;}

		.v2{width: 1000px;padding-bottom: 40px;margin-top: 100px;border-bottom:solid 1px gray;display: flex;
			justify-content: space-between;}
		.v2-1{font-size: 20px;}
		.v2-2{font-size: 20px;color: dimgrey; margin: 10px 0;}
		.v2-3{color: skyblue;border: solid 2px skyblue;background-color: aliceblue;}
		.v3{font-size: 18px;}
		.v3-1{font-size: 20px;color: red;}
		.v4{font-size: 20px;color: white;border-radius: 50px;background-color: red;width: 100px;text-align: center;    margin-top: 10px;}

		.v9{width: 1000px;height: 200px;margin-top: 240px;margin-left: 0px;border-bottom:solid 1px gray;}
		.v9-1{font-size: 20px;}
		.v9-2{font-size: 20px;color: dimgrey;}
		.v9-3{color: skyblue;border: solid 2px skyblue;background-color: aliceblue;}
		.v10{font-size: 18px;position: absolute;left: 1050px;top: 1330px;}
		.v10-1{font-size: 20px;color: red;}
		.v11{font-size: 20px;color: white;border-radius: 50px;background-color: red;width: 100px;text-align: center;position: absolute;left: 1200px;top: 1350px;}
		.z1-1>a:hover {background-color: red;color: white;border-radius: 30px;}
		.z1-2>a:hover {background-color: red;color: white;border-radius: 30px;}
		.z1-3>a:hover {background-color: red;color: white;border-radius: 30px;}
		.z1-4>a:hover {background-color: red;color: white;border-radius: 30px;}
		.v4>a {color: white;}
		.v11>a{color: white;}
		body{width: 100%;height: 100%;}
		*{margin: 0;padding: 0;}
		.bjt{background:radial-gradient(#6f4351,#40325b);width: 100%;height: 120px;}
		.huixiang{width: 200px;height: 80px;position: absolute;left: 0px;top: 10px;}
		.ziti{font-size: 25px;font-style: italic;font-family: 宋体;color:#91b5ff ;font-weight: 600;position: absolute;left:180px;top: 44px;}
		li{float: left;font-size: 22px;padding: 10px;margin-left: 60px;color: aqua;}
		.liebiao{position: absolute;left: 300px;top: 35px;}
		.zixuankuang{font-size: 12px;color: gray;width: 210px;height:38px;position: absolute;left: 1100px;top: 38px;border-radius: 50px;}
		.yonghu{border-radius: 50px;width: 50px;height: 50px;position: absolute;left: 1390px;top: 30px;}
		.denglu{font-size: 20px;position: absolute;left: 1440px;top: 50px;color:#91b5ff ;background-color: #40325b;border: solid  #423364;}

		.c1{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 450px;top: 50px;}
		.c1-1{color: red;}
		.c2{font-size: 18px;font-weight: 300;position: absolute;left: 520px;top:80px;color: white;}
		.c3{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 600px;top:120px;}
		.c4{height: 40px;width: 130px;position: absolute;left: 580px;top:180px;}
		.c5{height: 40px;width: 130px;position: absolute;left: 740px;top:180px;}
		.c6{height: 40px;width: 130px;position: absolute;left: 900px;top:180px;}


		li>a{color: white;}
		.z1-1>a:hover {color: red;}
		.z1-2>a:hover {color: red;}
		.z1-2>a:active{background-color: red;color: white;border-radius: 30px;}
		.z1-1>a:active{background-color: red;color: white;border-radius: 30px;}
		.z1-2>a:visited{background-color: red;}
		.denglu>a{color: white;}

		.x1-1{text-align: center;font-size: 25px;margin-top: 10px; width: 70%; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
		.x1-2{font-size: 30px;color: orange;font-style: italic;margin-top: 10px;}

		.x1{display: flex;
			flex-direction: column;
			align-content: center;
			min-height: 35vh;
			align-items: center;
		}
		.x2{
			min-height: 35vh;
			width: 80vw;
		}
		.active{background-color: red;color: white;border-radius: 30px;}
	</style>
</head>
<body>
<div class="bjt">
	<img src="img/R-C.png" class="huixiang">
	<div class="ziti">悦享汇电影</div>
	<div class="liebiao">
		<ul>

			<li><a href="shouye.jsp">首页</a></li>
			<li><a href="dianying.jsp">电影</a></li>
			<li><a href="yingyuan.jsp">影院</a></li>
			<li><a href="bangdan.jsp">榜单</a></li>
			<li><a href="redian.jsp">热点</a></li>
			<li><a href="shangcheng.jsp">商城</a></li>
		</ul>
	</div>
	<%@include file="sousuo.jsp"%>

	<img src="img/02(1).png" class="yonghu">

	<div>
		<div class="denglu">
			<a href="denglu.jsp">登录</a>
		</div>
		<div style="height: 1px"></div>
		<div style="width: 100%; display: flex; justify-items: center; justify-content: center; margin-top: 150px;">
			<div style="
			display: grid;
			grid-template-columns: repeat(5, 1fr);
			grid-row-gap: 3%;
			grid-column-gap: 3%;
			width: 100%;
			">
				<%
					Connection cn = null;
					PreparedStatement ps = null;
					String text = request.getParameter("text");
					int count = 0;
					ResultSet rs = null;
					String sql = "";
					cn = DBUtil.getConnection();
					PreparedStatement num = null;
					num = cn.prepareStatement("select count(*) as totalCount from goods WHERE name LIKE\"%"+text+"%\";");

					rs = num.executeQuery();
					if(rs.next()) {
						count = rs.getInt("totalCount");
					}
						sql = "select * from goods";
					sql = sql + " WHERE name LIKE\"%"+text+"%\";";
					System.out.println(sql);
					ps = cn.prepareStatement(sql);
					rs = ps.executeQuery();
					while(rs.next()){
						int id = rs.getInt("id");
						String name = rs.getString("name");
						String img = rs.getString("img");
						String number = rs.getString("number");
				%>
				<div class="x1">
					<img src="<%=img%>" width="160" height="220" >
					<div class="x1-1"><%=name%></div>
					<div class="x1-2"><%=number%></div>
				</div>
				<%
					}
					if (count == 0){
				%>
				<div class="x2">
					<h1>对不起,没有该资源!<%=count%></h1>
				</div>
				<%
					}
				%>
			</div>
		</div>
	</div>
	<div class="si">
		<div class="c1">关于悦享汇：<span class="c1-1">关于我们	| 管理团队 | 投资者关系 |</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;友情链接：<span class="c1-1">美团网 | 美团下载 | 欢喜首映 |</span></div>
		<div class="c2">QQ邮箱：2112633811.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客服电话：152425125</div>
		<div class="c3">悦享汇用户服务协议 |			悦享汇平台交易规则总则 | 			隐私政策 |</div>
		<img src="img/C9.png"class="c4" >
		<img src="img/C8.png"class="c5" >
		<img src="img/C7.png"class="c6" >
	</div>
</div>
</div>

</body>
</html>

